<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('异常日志列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 search-collapse">
				<form id="formId">
					<div class="select-list">
						<ul>
							<li>
								日志详情：<input type="text" name="content"/>
							</li>

							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
								<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
			
	        <div class="btn-group-sm" id="toolbar" role="group">
				<a class="btn btn-danger btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="monitor:exceLog:remove">
					<i class="fa fa-remove"></i> 删除
				</a>
			</div>
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table" data-mobile-responsive="true"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
		var detailFlag = [[${@permission.hasPermi('monitor:exceLog:detail')}]];
		var removeFlag = [[${@permission.hasPermi('monitor:exceLog:remove')}]];
        var prefix = ctx + "monitor/exceLog";

        $(function() {
            var options = {
                url: prefix + "/list",
				uniqueId: "id",
				detailUrl: prefix + "/detail/{id}",
				removeUrl: prefix + "/remove",
                modalName: "异常日志",
		        showExport: true,
                columns: [{
		            checkbox: true
		        },
				{
					field: 'actionMethod',
					title: '异常方法',
					align: 'center',
					formatter: function(value, row, index) {
						return $.table.tooltip(value, 32);
					}
				},
				{
					field : 'url',
					title : '异常路径',
					align: 'center'
				},
				{
					field : 'runTime', 
					title : '执行时长（ms）',
					align: 'center'
				},
				{
					field : 'ipAddr', 
					title : '操作地点',
					align: 'center'
				},
				{
					field : 'createTime',
					title : '异常时间',
					align: 'center',
					sortable: true
				},
				{
					field : 'operName',
					title : '操作人',
					align: 'center'
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
						actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详情</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>